#{extends 'overlay.html' /}
<div id="crudShow" class="${type.name}">
<script type="text/javascript">

$(function(){
	$("#accordion").accordion({autoHeight:false });
	
	});
	
	
function showLoader(id,select){
	var element=document.getElementById(id);
	var loader=document.getElementById(select);
	loader.style.position="absolute";
	loader.style.top=element.style.top;
	element.disabled=true;
	loader.style.visibility="visible";
}
function hideLoader(id,select){
	var element=document.getElementById(id);
	var loader=document.getElementById(select);
	element.disabled=false;
	loader.style.visibility="hidden";
}
function getInSprint(){
var i=document.getElementById('meetingTypesList').selectedIndex;
var param=document.getElementById('meetingTypesList').options[i].text;
var n=&{object.id};
$.post('@{isMeetingTypeAssociatedToSprint()}',{id:n,meetingType:param},function (flag){
if(flag){
document.getElementById('inSprintLbl').innerHTML="The ("+param+") Meeting Type is Associated To Sprints.";

}
else{
document.getElementById('inSprintLbl').innerHTML="The ("+param+") Meeting Type is Not Associated To Sprints.";
}
},'json')


}

function addMeeting(){
showLoader('addMB','loaderMB');
var n=&{object.id};
var m=document.getElementById('meetingText').value;
var x=document.getElementById('assocSprint').checked;

if(m==""){
$.bar({message:'You Must Enter a Meeting Type.'});
hideLoader('addMB','loaderMB');
return;
}
if(m.length >50){
	$.bar({message:'You Must Enter a Smaller Name.'});
	hideLoader('addMB','loaderMB');
	return;
	}
$.post('@{meetingTypesCheck()}',{id:n,type:m},function(exist){
	if (!exist) 
	{
		$.post('@{addMeetingType()}', {
			id: n,
			meetingType: m,
			inSprint: x
		}, function(flag){

if(flag){
var select=document.getElementById('meetingTypesList');
var optn = document.createElement("OPTION");
optn.text = m;
optn.value = m;
select.options.add(optn);

}
else{
$.bar({message:"Meeting Type couldn'"+'t be added.'});
}


hideLoader('addMB','loaderMB');
},'json')
}
	else
	$.bar({message:'Meeting type name is already used.'});
})
document.getElementById('meetingText').value="";
hideLoader('addMB', 'loaderMB');
}



function getSelectedItem(select){
var i;
for(i=select.options.length-1;i>=0;i--)
{
if(select.options[i].selected)
break;
}
return i;
}

function removeMeeting(){
showLoader('removeMB','loaderMB');
var n=&{object.id};
var select=document.getElementById('meetingTypesList');
var i=getSelectedItem(select);
if(i <0){
hideLoader('removeMB','loaderMB');
return;
}
var m=select.options[i].innerHTML;
if(m=="")
{
hideLoader('removeMB','loaderMB');
return;
}
var conf=confirm("Are you sure you want to delete this type?");

if(conf){
$.post('@{removeMeetingType()}',{id:n,meetingType:m},function (flag){

if(flag){
select.remove(i);
}
else{
$.bar({message:"Meeting Type was not Removed."});
}
},'json')
}
hideLoader('removeMB','loaderMB');
}

function ManageTaskTypes(optionName)
{
	if (optionName == "") 
	{
		$('#addTaskTypeButton').attr("disabled", false);
		$('#editTaskTypeButton').attr("disabled", true);
		$('#removeTaskTypeButton').attr("disabled", true);
		$('#taskText').val('');
	}
	else
	{
		$('#addTaskTypeButton').attr("disabled", true);
		$('#editTaskTypeButton').attr("disabled", false);
		$('#removeTaskTypeButton').attr("disabled", false);
		$('#taskText').val(optionName);
	}	
}
function ManageTaskStatuses(optionName, isPending, isClosed)
{
	if(optionName=="")
	{
		$("#taskStatusesList option[name='addNewTaskStatus']").attr("selected", true);
		$('#taskTSText').val("");
		$('#addTaskStatusButton').attr("disabled", false);
		$('#editTaskStatusButton').attr("disabled", true);
		$('#removeTaskStatusButton').attr("disabled", true);
		if(isPending)
		{
			$('input[name="taskStatusGroup"]')[0].checked = true;
		}
		else if(isClosed)
		{
			$('input[name="taskStatusGroup"]')[1].checked = true;
		}
		else
		{
			$('input[name="taskStatusGroup"]')[2].checked = true;
		}
	}
	else
	{
		$("#taskStatusesList option[name='addNewTaskStatus']").attr("selected", false);
		$('#taskTSText').val(optionName);
		$('#addTaskStatusButton').attr("disabled", true);
		$('#editTaskStatusButton').attr("disabled", false);
		$('#removeTaskStatusButton').attr("disabled", false);
		if(isPending)
		{
			$('input[name="taskStatusGroup"]')[0].checked = true;
		}
		else
		{
			if(isClosed)
			{
				$('input[name="taskStatusGroup"]')[1].checked = true;
			}
			else
			{
				$('input[name="taskStatusGroup"]')[2].checked = true;
			}
		}
		
	}
	
}

function addTaskStatus()
{
	if (!$('#taskStatusesList option:selected').length) 
	{
		$.bar({message:'Please select a Task Status from the list.'});
		return
	}
	showLoader('addTaskStatusButton','loaderTST');
	var projectId = &{object.id};
	var textFeildValue = $('#taskTSText').val();
	var rad_val = $("input[name='taskStatusGroup']:checked").val();
	var statusId;
	if(textFeildValue == "" || textFeildValue.length > 50 )
	{
		$.bar({message:'You Must Enter a Valid Task Status Name.'});
	}
	else
	{
		$.post('@{taskStatusCheck()}',{id:projectId,status:textFeildValue},
				function(exist)
				{
			       if (!exist)
				   {
					   $.post('@{addTaskStatus()}', {id:projectId,taskStatus:textFeildValue,indicator:rad_val}, 
							   function(id) //id: Task Status id
							   {    
						          if(id)
							      {
								      statusId = id;
								      var select=document.getElementById('taskStatusesList');
								      var optn = document.createElement("OPTION");
									  optn.text = textFeildValue;
									  optn.value = id;
									  select.options.add(optn);
									  $('#taskStatusesList option[value='+id+']').click(
										function()
										{
											ManageTaskStatuses(textFeildValue, rad_val=="Pending", rad_val=="Closed");
										})
									    ManageTaskStatuses("", false, false);
									    $.bar({message:'You have succesfully added a new Task Status.'});
								 }
								 else
								 {
									$.bar({message:'Task Status could not be added.'});
									ManageTaskStatuses("", rad_val=="Pending", rad_val=="Closed");
									document.getElementById('taskTSText').value=textFeildValue;
								 }
							  } ,'json')
					}
					else
					{
						$.bar({message:'Task status name is already used.'});
						ManageTaskStatuses("", rad_val=="Pending", rad_val=="Closed");
						document.getElementById('taskTSText').value=textFeildValue;
					} 
       			})
	}
	hideLoader('addTaskStatusButton', 'loaderTST');
}

function editTaskStatus()
{
	if (!$('#taskStatusesList option:selected').length) 
	{
		$.bar({message:'Please select a Task Status from the list.'});
		return
	}
	showLoader('editTaskStatusButton','loaderTST');
	var projectId = &{object.id};
	var select=document.getElementById('taskStatusesList');
	var i = getSelectedItem(select);
	var x = document.getElementById('taskTSText').value;
	var rad_val = $("input[name='taskStatusGroup']:checked").val()
	var m = select.options[i].value;
	
	if(i<0)
	{
		hideLoader('editTaskStatusButton','loaderTST');
		return;
	}
	if(x==""  || x.length >50)
	{
		$.bar({message:'You Must Enter a Valid Task Status Name.'});
	}
	else
	{
		$.post('@{newTaskStatusCheck()}',{statusID:m,id:projectId,status:x},
			function(exist)
			{
		      if (!exist) 
			  {
				  $.post('@{editTaskStatus()}',{statusID:m,newName:x,indicator:rad_val},
						  function (flag)
						  {
					        if(flag)
						    {
							    $('#taskStatusesList option[value='+m+']').html(x);
							    $('#taskStatusesList option[value='+m+']').click(function() {
							    	ManageTaskStatuses(x, rad_val=="Pending", rad_val=="Closed");
					        	})
								$('#taskStatusesList option[value='+m+']').attr("selected", true);
							    ManageTaskStatuses(x, rad_val=="Pending", rad_val=="Closed");
								$.bar({message:'You have succesfully editted a Task Status.'});
							}
							else
							{
								$.bar({message:'Task Status could not be editted.'});
								$('#taskStatusesList option[value='+m+']').attr("selected", true);
								ManageTaskStatuses(x, rad_val == "Pending", rad_val == "Closed");
							}
						} ,'json')
			 }
			 else
			 {
				 $.bar({message:'Task status name is already used.'});
				 $('#taskStatusesList option[value='+m+']').attr("selected", true);
				 ManageTaskStatuses(x, rad_val == "Pending", rad_val == "Closed");
			 }
		   })
	}
	hideLoader('editTaskStatusButton','loaderTST');
}

function removeTaskStatus()
{
	if (!$('#taskStatusesList option:selected').length) 
	{
		$.bar({message:'Please select a Task Status from the list.'});
		return
	}
	showLoader('removeTaskStatusButton','loaderTST');
	var taskStatusesList = document.getElementById('taskStatusesList');
	var selectedItem = getSelectedItem(taskStatusesList);
	var conf = confirm("Are you sure you want to delete this task status?");
	var select=document.getElementById('taskStatusesList');
	var i = getSelectedItem(select);
	var m = select.options[i].value;
	if(selectedItem < 0)
	{
		hideLoader('removeTaskStatusButton','loaderTST');
		return;
	}
	if(conf)
	{
		$.post('@{removeTaskStatus()}',{statusID:m},
				function (flag)
				{
			      if(flag)
				  {
			    	  taskStatusesList.remove(selectedItem);
			    	  $.bar({message:'You have succesfully removed a Task Status.'});
				  }
				  else
				  {
					  $.bar({message:'Task Status could not be removed.'});
				  }
				} ,'json')
		$('#taskTSText').val("");
		$('#addTaskStatusButton').attr("disabled", true);
		$('#editTaskStatusButton').attr("disabled", true);
		$('#removeTaskStatusButton').attr("disabled", true);
	}
	hideLoader('removeTaskStatusButton', 'loaderTST');
	$('#taskTSText').val("");
	$('#addTaskStatusButton').attr("disabled", true);
	$('#editTaskStatusButton').attr("disabled", true);
	$('#removeTaskStatusButton').attr("disabled", true);
}

function c(optionName)
{
	if(optionName=="")
	{
		$("#taskTypesList option[name='addNewTaskType']").attr("selected", true);
		$('#taskText').val("");
		$('#addTaskTypeButton').attr("disabled", false);
		$('#editTaskTypeButton').attr("disabled", true);
		$('#removeTaskTypeButton').attr("disabled", true);
	}
	else
	{
		$("#taskTypesList option[name='addNewTaskType']").attr("selected", false);
		$('#taskText').val(optionName);
		$('#addTaskTypeButton').attr("disabled", true);
		$('#editTaskTypeButton').attr("disabled", false);
		$('#removeTaskTypeButton').attr("disabled", false);		
	}
}

function addTaskType()
{
	showLoader('addTaskTypeButton','taskTypesLoader');
	var n=&{object.id};
	var m=document.getElementById('taskText').value;
	if(m=="")
	{
		$.bar({message:'You Must Enter a Task Type.'});
		hideLoader('addTaskTypeButton','taskTypesLoader');
		return;
	}
	if(m.length > 50)
	{
		$.bar({message:'You Must Enter a Smaller Type.'});
		hideLoader('addTaskTypeButton','taskTypesLoader');
		return;
	}
	$.post('@{taskTypesCheck()}',{id:n , type:m},
			function(exist)
			{
		       if (!exist)
			   {
				   $.post('@{addTaskType()}', {id: n,taskType: m}, 
						   function(id)
						   {
					          if(id)
						      {
							      var select=document.getElementById('taskTypesList');
							      var optn = document.createElement("OPTION");
							      optn.text = m;
							      optn.value = id;
							      select.options.add(optn);
							      ManageTaskTypes("");
								  $.bar({message:'You have succesfully added a new Task Type.'});
							  }
							  else
							  {
								  $.bar({message:'Task Type could not be added.'});
								  ManageTaskTypes("");
								  document.getElementById('taskText').value = m;
							  }
							  hideLoader('addTaskTypeButton','taskTypesLoader');
						 },'json')
			}
			else
			{
				$.bar({message:'Task Type name is already used.'});
				ManageTaskTypes("");
				document.getElementById('taskText').value = m;
			}
		})
	hideLoader('addTaskTypeButton', 'taskTypesLoader');
}

function editTaskType()
{
	if (!$('#taskTypesList option:selected').length) 
	{
		$.bar({message:'Please select a Task Type from the list.'});
		return
	}
	showLoader('editTaskTypeButton','taskTypesLoader');
	var projectId = &{object.id};
	var select=document.getElementById('taskTypesList');
	var i = getSelectedItem(select);
	var x = document.getElementById('taskText').value;
	var m = select.options[i].value;
	
	if(i<0)
	{
		hideLoader('editTaskTypeButton','taskTypesLoader');
		return;
	}
	
	if(x=="" || x.length >50 )
    {
	    $.bar({message:'You Must Enter a Valid Task Type Name.'});
    }
	else
	{
		$.post('@{newtaskTypesCheck()}',{taskTypeId:m,projectId:projectId,type:x},
			function(exist)
			{
		      if (!exist) 
			  {
				  $.post('@{editTaskType()}',{typeId:m,newName:x},
						  function (flag)
						  {
					        if(flag)
						    {
							    $('#taskTypesList option[value='+m+']').html(x);
							    $('#taskTypesList option[value='+m+']').click(
									    function() 
									    {
									    	ManageTaskTypes(x);
										})
								$('#taskTypesList option[value='+m+']').attr("selected", true);
							    ManageTaskTypes(x);
								$.bar({message:'You have succesfully editted a Task Type.'});
							}
							else
							{
								$.bar({message:'Task Type could not be editted.'});
								$('#taskTypesList option[value='+m+']').attr("selected", true);
								ManageTaskTypes(x);
							}
						} ,'json')
			 }
			 else
			 {
				 $.bar({message:'Task Type name is already used.'});
				 $('#taskTypesList option[value='+m+']').attr("selected", true);
				 ManageTaskTypes(x);
			 }
		   })
	}
	hideLoader('editTaskTypeButton','taskTypesLoader');
}

function removeTaskType()
{
	showLoader('removeTaskTypeButton','taskTypesLoader');
	var select=document.getElementById('taskTypesList');
	var i=getSelectedItem(select);
	if(i<0)
	{
		hideLoader('removeTaskTypeButton','taskTypesLoader');
		return;
	}
	var m=select.options[i].value;
	var conf=confirm("Are you sure you want to delete this type?");
	if(conf)
	{
		$.post('@{removeTaskType()}',{taskID:m},
				function (flag)
				{
			      if(flag)
				  {
					  select.remove(i);
					  $.bar({message:'You have succesfully removed a Task Type.'});
				  }
				  else
				  {
					  $.bar({message:'Task Type could not be Removed.'});
				  }
			    },'json')
		$('#taskText').val("");
		$('#addTaskTypeButton').attr("disabled", true);
		$('#editTaskTypeButton').attr("disabled", true);
		$('#removeTaskTypeButton').attr("disabled", true);
	}
	hideLoader('removeTaskTypeButton','taskTypesLoader');
	$('#taskText').val("");
	$('#addTaskTypeButton').attr("disabled", true);
	$('#editTaskTypeButton').attr("disabled", true);
	$('#removeTaskTypeButton').attr("disabled", true);
}

function addStory(){
showLoader('addST','loaderST');
var n=&{object.id};
var m=document.getElementById('storyText').value;
var x=document.getElementById('priorityText').value;
if(m=="" || !is_int(x) || m.length >50 || x.length >50 || x=="0" ){

$.bar({message:"You Must Enter a Valid Priority Title and an Integer Priority Value."});
hideLoader('addST','loaderST');
return;
}

$.post('@{storyPriorityCheck()}',{id:n ,pName:m},function(exist){
	
	if (!exist) {
	
		$.post('@{addStoryType()}', {
			id: n,
			storyType: m,
			unit: x
		}, function(id){

if(id) {
var select=document.getElementById('storiesTypesList');
var optn = document.createElement("OPTION");
optn.text = x+": "+m;
optn.value= id;

select.options.add(optn);

}
else{
$.bar({message:"Story Type couldn't be added."});
}

hideLoader('addST','loaderST');
},'json')
}
	else
	$.bar({message:"Priority Title is already used."});
})
hideLoader('addST', 'loaderST');
document.getElementById('storyText').value="";
document.getElementById('priorityText').value="";
}


function removeStory(){
showLoader('removeST','loaderST');
var n=&{object.id};
var select=document.getElementById('storiesTypesList');
var i=getSelectedItem(select);
if(i<0){
hideLoader('removeST','loaderST');
return;
}
var m=select.options[i].value;

var conf=confirm("Are you sure you want to delete this type?");
if(conf){
$.post('@{removeStoryType()}',{priorityID:m},function (flag){
if(flag){
select.remove(i);

}
else{
$.bar({message:"Story Type was not Removed."});

}

},'json')
}
hideLoader('removeST','loaderST');
}


function changeAutoRS(){
var n=&{object.id};
var m=document.getElementById('checkBoxAutoRS').value;

$.post('@{changeAutoRescheduleStatus()}',{id:n,autoReschedule:m},function (flag){
var conf=confirm("Are you sure you want to change the status of Auto-Rescheduling?");
if(flag && conf){

}
else{
$.bar({message:"Could not Commit Action! Please Try again."});
}
},'json')
}

function is_int(value){
  if( !isNaN(value) & (parseInt(value)==parseFloat(value)) ){
      return true;
 } else {
      return false;
 } 
}

function setSprintDuration(){
showLoader('addSP','loaderSP');
var i=document.getElementById('sprintDropDown').selectedIndex;

var param=document.getElementById('sprintDropDown').options[i].text;



var n=&{object.id};
var m=document.getElementById('durationText').value;
var d=parseInt(m);
var dn=d;

if((!is_int(m)) || d<=0){
$.bar({message:"The duration entered is invalid. Please enter a valid Integer Duration."});
hideLoader('addSP','loaderSP');
return;
}
else if(m){

switch (param){

case "Months":
dn=d*30;
break;

case "Weeks":
dn=d*7;
break;
default:


}
hideLoader('addSP','loaderSP');
}

$.post('@{setDefaultSprintDuartion()}',{id:n,duration:dn},function (flag){

if(flag){
document.getElementById('sprintDuration').innerHTML=dn;

}
else{
$.bar({message:"Duration Coudln't be Set."});
}
hideLoader('addSP','loaderSP');
},'json');

}

function setEffortUnit(){
showLoader('addES','loaderES');
var i=document.getElementById('estimationDown').selectedIndex;

var param=document.getElementById('estimationDown').options[i].text;

var n=&{object.id};

$.post('@{setEffortEstimationUnit()}',{id:n,unit:param},function (flag){
if(flag){
$.bar({message:"You Have set the Effort Estimation Unit to :"+param});
document.getElementById('estimationLabel').innerHTML=param;
}
},'json')
hideLoader('addES','loaderES');

}


</script>
	
	<h2 id="crudShowTitle">Edit "&{object.name}" Defaults and Settings </h2>
	
	
<p>	&{object.description}</p> 
	
	<div class="objectForm">
	


<div id="accordion">
#{if connected.in(object).can('editProject') }
	<h6><a href="#">Default Sprint Duration</a></h6>
	
	<div id="sd" class="sprintsDuration">
	
		#{note}	Setting default sprint duration will be used when an end date for the sprint date is not specified upon creation.#{/note}
		<div class="crudField"> Current Default Sprint Duration : <a id = "sprintDuration" style="color:red">&{object.sprintDuration}</a> Days.</div> 
		<div class="crudField">
		<input id="durationText" type="text"  value="" "size="10" /> in
	<select id="sprintDropDown" name="sprintDropDown">
		<option value="Days">Days</option>
		<option value="Months">Months</option>
		<option value="Weeks">Weeks</option>
		</select>
		</div>
		<div class="crudField">
	<input id="addSP"type="button" name="add" value="Set" onclick="setSprintDuration()" />
	<img id="loaderSP"  style="visibility:hidden" src="/public/images/loading16.gif"/>
	</div>
		</div>
		#{/if}
		#{if connected.in(object).can('editProject') }
	<h6><a href="#">Meeting Types</a></h6>
	<div class="meetingTypes">
	
	#{note}Click On a Meeting Type to view Sprint Association#{/note}
	 <b><label id="inSprintLbl"></label></b><br/>
	<div class="left" style="padding-top:10px">
	
	<label>Meeting Types</label> 
	<form> 
	<select name="drop1" id="meetingTypesList" style="width:200px" size="10" multiple="multiple" onclick="getInSprint()">
		#{list items:object.meetingsTypes, as:'meetingType'}
			<option value="1">${meetingType}</option>
		#{/list}
	</select>
	
</div>
<div class="left" style="margin-top:10px;height:100%;margin-left:10px; padding-left:5px">
 
<div class="crudField">
Add new <input id="meetingText" class="" type="text" name="object.name"  /> 
	</div><div class="crudField">
	<INPUT id="assocSprint"TYPE=CHECKBOX NAME="assocSprint"  onclick="" > 	Associate New Type To End Of Sprint
	
	</div><div class="crudField">
	<input id="addMB"type="button" name="add" value="Add" onclick="addMeeting()" />
	
	<input id="removeMB" type="button" name="add" value="Remove" onclick="removeMeeting()"/>
	
	<img id="loaderMB"  style="visibility:hidden" src="/public/images/loading16.gif"/>
	</div>
	</div>
	</div>
	#{/if}
	
#{if connected.in(object).can('editProject') }
  <h6> <a href="#">Task Types</a> </h6>
  <div class="taskTypes">
    <div class="left" style="padding-top:10px">
      <label>Task Types</label>  <br/>
      <select name="taskTypesList" id="taskTypesList" style="width:200px" size="10">
        <option value="addNewTaskType" name="addNewTaskType" onclick="ManageTaskTypes('')" selected > Add new Task Type</option>
        #{list items:object.taskTypes, as:'taskType'}
          #{if taskType.deleted==false}
            <option value=${taskType.id} onclick="ManageTaskTypes($(this).html())">${taskType.name}</option>
          #{/if}
        #{/list}
      </select>
    </div>
    <div class="left" style="margin-top:10px;height:100%;margin-left:10px; padding-left:5px">
      <div class="crudField">
        Type Name <input id="taskText" class="" type="text" name="object.name" value="" "size="27" />
      </div>
      <div class="crudField">
        <input id="addTaskTypeButton" type="button" title="Add a new Task Type"  name="add" value="Add" onclick="addTaskType()" />
        <input id="editTaskTypeButton" type="button" title="Save after editing" name="edit" value="Edit" onclick="editTaskType()" />
        <input id="removeTaskTypeButton" type="button" title="Remove from project"  name="remove" value="Remove" onclick="removeTaskType()"/>
        <img id="taskTypesLoader"  style="visibility:hidden" src="/public/images/loading16.gif"/>
      </div>
    </div>
  </div>
#{/if}

#{if connected.in(object).can('editProject') }
  <h6> <a href="#">Task Statuses</a> </h6>
  <div class="taskStatus">
    #{note}The status new can't be removed nor it's meaning changed#{/note}
	<div class="left" style="padding-top:10px">
	  <label>Task Statuses</label> <br/>
	  <select name="taskStatusesList" id="taskStatusesList" style="width:200px" size="10">
	    <option value="addNewTaskStatus" name="addNewTaskStatus" onclick="ManageTaskStatuses('',false,false)" selected > Add new Task Status</option>
	    #{list items:object.taskStatuses, as:'taskStatus'}
	      #{if taskStatus.deleted==false}
	        <option value=${taskStatus.id} onclick="#{if taskStatus.isNew}$('#elForm').hide();$('#removeTaskStatusButton').hide();#{/if}#{else}$('#elForm').show();$('#removeTaskStatusButton').show();#{/else}ManageTaskStatuses($(this).html(),${taskStatus.pending},${taskStatus.closed})" >${taskStatus.name}</option>
	      #{/if}
	    #{/list}
	  </select>
	</div>
	<div class="left" style="margin-top:10px;height:100%;margin-left:10px; padding-left:5px">
	  <div class="crudField">
	    Status Name&nbsp;<input id="taskTSText" class="" type="text" name="object.name" value="" "size="27" /> 
	  </div>
	  <div id="elForm" class="crudField">
	    <form  name="taskStatusesForm">
	      This status indicates  <br/>
	      <input type="radio" name="taskStatusGroup" value="Pending"> Pending <br/>
	      <input type="radio" name="taskStatusGroup" value="Closed"> Closed <br/>
	      <input type="radio" name="taskStatusGroup" value="Others" checked> Others <br/>
	    </form>
	  </div>
	  <div class="crudField">
	    <input id="addTaskStatusButton"" type="button" title="Add a new Task Status" name="add" value="Add" onclick="addTaskStatus()" />
	    <input id="editTaskStatusButton" type="button" title="Save after editing" name="edit" value="Edit" onclick="editTaskStatus()" disabled/>
	    <input id="removeTaskStatusButton" type="button" title="Remove from project" name="remove" value="Remove" onclick="removeTaskStatus()" disabled/>
	    <img id="loaderTST"  style="visibility:hidden" src="/public/images/loading16.gif"/>
	  </div>
	</div>
  </div>
#{/if}
		
#{if connected.in(object).can('editProject') }
	<h6>
		<a href="#">Task Priorities</a>
		</h6>
	<div class="storyPriorities">
	

<div class="left" style="margin-top:10px;">
		Story Priorities<br/>
<select name="drop1" id="storiesTypesList" style="width:200px" size="10" multiple="multiple">
#{list items:object.priorities, as:'storiesPriority'}
		
		#{if storiesPriority.deleted==false}
		<option value="${storiesPriority.id}">${storiesPriority.priority} : ${storiesPriority.title}</option>
		#{/if}
		
	
		
	
#{/list}
	</select>
	
	</div>
<div class="left" style="margin-top:10px;height:100%;margin-left:10px; padding-left:5px">
	<div class="crudField">
	Priority Title:&nbsp;<input id="storyText" class="" type="text" name="object.name" value="" "size="15" />
	</div>
	<div class="crudField">
	Priority Value:<input id="priorityText" class="" type="text" name="" value="" "size="15" />
	</div>
	<div class="crudField">
	<input id="addST" type="button" name="add" value="Add" onclick="addStory()" />
	<input id="removeST" type="button" name="add" value="Remove" onclick="removeStory()"/>
	
		<img id="loaderST"  style="visibility:hidden" src="/public/images/loading16.gif"/>
		</div>
		</div>
		</div>
		#{/if}
		#{if connected.in(object).can('editProject') }
	<h6>
		<a href="#">Meeting Rescheduling Policies</a>
		</h6>
		<div class="meetingReSchedule">
		#{note}
		This Feature allows the application to reschedule meeting for the " &{object.name} " project automatically when the sprint date
		changes. To turn on feature check the box below.
		#{/note}
		 <INPUT id="checkBoxAutoRS"TYPE=CHECKBOX NAME="autoReschedule"  onclick="changeAutoRS()"  ${object.autoReschedule ? 'checked': ''} >Auto Meeting Reschedule</p>
		</div>
		#{/if}
<!-- 		#{if connected.in(object).can('editProject') } -->
<!-- 	<h6><a href="#">Effort Estimation Points Unit</a></h6> -->
<!-- 				<div class="mee"> -->
<!-- 				#{note} -->
<!-- 		You can Set the Effort Estimation Unit either in Hours or Points. -->
<!-- 		#{/note} -->
<!-- 	<p>Current Effort  Estimation Unit : <label id="estimationLabel" style="color:red"> -->
	
<!-- 		#{if object.effortEstimationUnit==0} -->
<!-- 				Hours -->
<!-- 		#{/if} -->
<!-- 		#{if object.effortEstimationUnit!=0} -->
<!-- 				Points -->
<!-- 		#{/if} -->
	
	
<!-- 	 </label><br/> -->
<!-- 	<select id="estimationDown" name="estimationDropDown"> -->
<!-- 		<option value="Hours">Hours</option> -->
<!-- 		<option value="Points">Points</option> -->
<!-- 		</select> -->
		
<!-- 	<input id="addES"type="button" name="add" value="Set" onclick="setEffortUnit()" /> -->
<!-- 	<img id="loaderES"  style="visibility:hidden" src="/public/images/loading16.gif"/> -->

<!-- 		</div> -->
<!-- 	#{/if} -->
	
</div>
